package com.example.myapplication2222;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;

public class ImageViewMainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_view_main);

        ImageView img = findViewById(R.id.imgID);
        img.setImageResource(R.drawable.ic_launcher_background);
        ;
        img.setScaleType(ImageView.ScaleType.FIT_XY);

        ImageButton imgbtn = findViewById(R.id.img111);
        imgbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();///返回上一级

            }
        });

    }
}